package multithreading;

public class ThreadDemo extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println("并发执行"+ Thread.currentThread().getName());
        }
    }

    public static void main(String[] args) {
        //线程状态 1new状态
        ThreadDemo demo = new ThreadDemo();
        demo.start();
        for (int i = 0; i < 30; i++) {
            System.out.println("主线程 并发执行"+Thread.currentThread().getName());
        }
    }
}
